package com.lonely.product.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lonely.common.core.domain.StatusInfo;
import com.lonely.product.domain.dto.postfinishing.PostFinishingCompletedDTO;
import com.lonely.product.domain.dto.postfinishing.QueryOrderPostFinishingPageDTO;
import com.lonely.product.domain.dto.postfinishing.StartPostFinishingDTO;
import com.lonely.product.domain.entity.SysOrderPostFinishing;
import com.lonely.product.domain.vo.postfinishing.QueryOrderPostFinishingPageVO;
import com.lonely.system.domain.entity.SysFactory;

import java.util.List;

/**
 * @author : 黄志标
 * @date: 2025/8/12 9:40
 * @description: 订单后整服务接口
 */
public interface IOrderPostFinishingService extends IService<SysOrderPostFinishing> {

    /**
     * 生成订单后整数据
     *
     * @param produceOrderId
     */
    void createOrderPostFinishing(Long produceOrderId);

    /**
     * 后整分页查询
     *
     * @param queryDto
     * @return
     */
    Page<QueryOrderPostFinishingPageVO> page(QueryOrderPostFinishingPageDTO queryDto);

    /**
     * 获取状态信息
     *
     * @param queryDto
     * @return
     */
    List<StatusInfo> getStatusInfo(QueryOrderPostFinishingPageDTO queryDto);

    /**
     * 外发后整分页查询
     *
     * @param queryDto
     * @return
     */
    Page<QueryOrderPostFinishingPageVO> outsourcePage(QueryOrderPostFinishingPageDTO queryDto);

    /**
     * 获取外发后整状态信息
     *
     * @param queryDto
     * @return
     */
    List<StatusInfo> getOutsourceStatusInfo(QueryOrderPostFinishingPageDTO queryDto);

    /**
     * 开始后整
     *
     * @param requestDto
     */
    void startPostFinishing(StartPostFinishingDTO requestDto);

    /**
     * 订单尾部分单后置处理
     *
     * @param produceOrderIds
     * @param sysFactory
     */
    void orderTailSplitAfterProcess(List<Long> produceOrderIds, SysFactory sysFactory);

    /**
     * 后整完工
     *
     * @param requestDto
     */
    void postFinishingCompleted(PostFinishingCompletedDTO requestDto);

    /**
     * 获取默认的开始后整数
     *
     * @param postFinishingId
     * @return
     */
    String getDefaultStartPostFinishingQuantity(Long postFinishingId);

    /**
     * 获取默认的后整完工数
     *
     * @param postFinishingId
     * @return
     */
    String getDefaultCompletedPostFinishingQuantity(Long postFinishingId);

}
